package gps.implementationAPI;

import gps.Colors;
import gps.GPSRun;
import gps.api.GPSState;
import gps.states.SquareState;

public class GPSProblemHeu2Implementation extends GPSGenericProblemImplementation {

	public GPSProblemHeu2Implementation() {
		super();
	}
	
	public static Integer getMaxValue(){
		return (GPSRun.N*GPSRun.N - 1)*2;
	}
	
	@Override
	public Integer getHValue(GPSState state) {
		
		int ret = 0;
		
		for(int i = 0 ; i < GPSRun.N ; i++){
			for (int j = 0 ; j < GPSRun.N ; j++){
				SquareState ss = state.getElementState(i, j);
				
				if(ss == null){
					continue;
				}
				
				if(ss.isUniform()) {
					if (ss.getFirstColor() == Colors.BLACK){
						ret += 2;
					}
				} else {
					ret++;
				}
			}
		}
		
		return ret;
	}
	
	
	
	

}
